/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: array.cpp
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月22日 星期二 11时05分20秒
***************************************************/

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

class Array {
	int arr[10];
	int elements = 10;
	
public:
	void set(int index, int val)
	{
		arr[index] = val;
	}
	int get(int index)
	{
		return arr[index];
	}
	int find_max()
	{
		return 0;
	}
	void sort()
	{
		
	}
	// 重载运算符[]
	int& operator[](int index)
	{
		return arr[index];
	}
};

int main(int argc,const char* argv[])
{
	int arr[10];
	arr[0] = 10;
	
	Array arr_obj;
	arr_obj.set(0, 10);
	arr_obj.set(1, 15);
	
	//arr_obj[2] = 20;
	
	#if 0
	int n;
	n = 10;
	int &rn = n;
	rn = 5;
	#endif
	
	cout << arr_obj.get(2) << endl;
    return 0;
}
